package com.hiof.moraa.server.controller.restfulservice;

import com.hiof.moraa.server.service.PassTargetService;
import com.hiof.moraa.server.service.model.*;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/restfulservice")
public class NextTargetLocationInfoController {
    @Autowired
    PassTargetService passTargetService;
    
    @RequestMapping(value = "/nexttargetinfo", method = RequestMethod.POST)
    @ResponseBody
    public TargetInfoPacket targetInfoServiceMethod(
            @RequestParam("athleteId") int athleteId) throws Exception {
        return passTargetService.getNextTargetInfo(athleteId);
    }
}
